<template>
	<view class="box">
		<view class="list">
			<view class="card" v-for="(item,index) of list" :key="index">
				<view class="one fw-bt f24">
					<view>发票号: {{item.receipt_no||'暂无'}}</view>
					<view>{{item.create_time}}</view>
				</view>
				<view class="two fw-bt f30">
					<view>{{item.receipt_info.receipt_title}}</view>
					<view class="red bold">￥{{item.order_price}}</view>
				</view>
				<view class="three f24">
					开票时间: {{item.status_time}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1, //
				isMore: true, //
				list: []
			}
		},
		onReachBottom() {
			this.getlist(this.page + 1)
		},
		onLoad() {
			this.getlist(this.page);
		},
		methods: {
			// 列表
			getlist(e) {
				this.$request('user/receipt/order', {
					page: e,
					limit: 10
				}, 'GET').then(res => {
					if (res.status == 200) {
						if (e == 1) {
							this.list = res.data.list
						} else {
							if (res.data.list.length == 0) {
								uni.showToast({
									title: "暂无更多",
									icon: "none"
								})
								return
							}
							let list = this.list
							list = [...list, ...res.data.list]
							this.list = list
							this.page = e
						}
					}
				})
			}

		}
	}
</script>
<style>
	page {
		background-color: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
	.box {
		padding: 20rpx 30rpx;

		.card {
			margin: 0 auto 20rpx;
			width: 690rpx;
			padding: 26rpx 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			box-sizing: border-box;

			.two {
				margin: 19rpx auto;
				padding: 24rpx 10rpx;
				background: #F8F8F8;
				border-radius: 8rpx;
			}
		}
	}
</style>
